#include <time.h>

class Clock{
public:

	int Ticks;
	int LastTicks;
	int DeltaTicks;

	float Timeframe;


	Clock(){
		Ticks=0;
		LastTicks = 0;
	Timeframe = 1.0;
	UpdateClock();
	}

	void UpdateClock(){
	LastTicks = Ticks;
	Ticks = (clock()*1000/CLOCKS_PER_SEC);
	DeltaTicks = (int)(Ticks-LastTicks)*Timeframe;
	if(DeltaTicks > 500){DeltaTicks = 33;}
	}

	int GetTicks(){UpdateClock();return Ticks;}
	bool atInterval(int FPS){if(Ticks/(1000/FPS)-(LastTicks/(1000/FPS)) != 0)return true; else return false;}
	
};